package com.wxy.demo.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class CallableDemo<O> implements Callable<Object> {
    @Override
    public Object call() throws Exception {
        System.out.println("这是一个Callable");
        return true;
    }

    public static void main(String[] args) {
        CallableDemo<Object> callableDemo = new CallableDemo<>();
        FutureTask<Object> futureTask = new FutureTask<>(callableDemo);
        Thread thread = new Thread(futureTask);
        thread.start();
    }
}
